package com.mop.controller;

import com.mop.pojo.Reward;
import com.mop.pojo.User;
import com.mop.service.RewardService;
import com.mop.vo.PageResult;
import com.mop.vo.SysResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/reward")
public class RewardController {
    @Autowired
    private RewardService rewardService;
    @GetMapping("/getFind")
    public SysResult getFind(PageResult pageResult){
    pageResult=rewardService.getFind(pageResult);
        return SysResult.success(pageResult);
    }
    @PostMapping("/addReward")
    public SysResult addReward(@RequestBody Reward reward){
        rewardService.addReward(reward);
        return SysResult.success();

    }
    @DeleteMapping("/aa/{id}")
    public SysResult deleteReward(Reward reward){
        rewardService.deleteReward(reward);
        return SysResult.success();
    }
}
